package website.seamonster.ethegg.utils;

import website.seamonster.ethegg.viewobject.ResultVO;

/**
 * Created by 罗海量
 * 2018-07-22 23:43
 */
@lombok.extern.slf4j.Slf4j
public class ResultVOUtil {
    public static ResultVO success(Object object){
        ResultVO<Object> resultVO = new ResultVO<>();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        return resultVO;
    }

    public static ResultVO success(){
        return success(null);
    }

    public static ResultVO error(Integer code, String msg){
        ResultVO<Object> resultVO = new ResultVO<>();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }

}
